home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
B-Book Series
/
(k)b2.d64
/
bignuts
< prev
next >
Wrap
Text File
|
2007-02-28
|
2KB
|
75 lines
0010 //* PROGRAM: BIGNUTS *//
0020 INTRODUCTION
0030 GAME
0040 FINITO
0050 //* END OF PROGRAM: BIGNUTS *//
0060 //
0070 PROC INTRODUCTION
0080 //-PREPARE TO PLAY-//
0090 PRINT CHR$(147) //CLEAR SCREEN//
0100 PRINT "NOW WE ARE GOING TO PLAY"
0110 PRINT "'PEANUTS'."
0120 PRINT "HOW MANY GAMES SHOULD WE PLAY",
0130 INPUT MAX
0140 PRINT
0150 PRINT "OK, HERE WE GO:"
0160 PRINT "IF YOU THINK I AM HOLDING"
0170 PRINT "AN ODD NUMBER OF PEANUTS"
0180 PRINT "THEN ENTER 1;"
0190 PRINT "BUT IF YOU THINK I AM HOLDING"
0200 PRINT "AN EVEN NUMBER OF PEANUTS"
0210 PRINT "THEN ENTER 0"
0220 PRINT
0230 COUNTWIN:=0
0240 ENDPROC INTRODUCTION
0250 //
0260 PROC GAME
0270 FOR NO:=1 TO MAX DO
0280 //-THIS IS THE GAME ITSELF-//
0290 PRINT "WELL, WHAT IS YOUR GUESS (0,1)",
0300 INPUT GUESS
0310 STAKED:=RND(1,8)
0320 OUTCOME:=STAKED MOD 2
0330 PRINT
0340 RESULT
0350 WINNER
0360 PRINT
0370 IF NO<MAX THEN PRINT "NEXT GAME:"
0380 ENDFOR NO
0390 ENDPROC GAME
0400 //
0410 PROC FINITO
0420 //-FINAL RESULT-//
0430 PRINT "THANKS FOR THE GAME!"
0440 IF COUNTWIN>0 THEN
0450 PRINT "YOU HAVE WON ",COUNTWIN," PEANUT(S)."
0460 ELSE
0470 PRINT "YOU HAVE LOST ",-COUNTWIN," PEANUT(S)."
0480 ENDIF
0490 PRINT
0500 PRINT "COME AND PLAY SOME OTHER DAY."
0510 ENDPROC FINITO
0520 //
0530 PROC RESULT
0540 IF OUTCOME=0 THEN
0550 PRINT "I AM HOLDING ",STAKED," PEANUTS"
0560 PRINT "I.E. AN EVEN NUMBER, ",
0570 ELSE
0580 PRINT "I AM HOLDING ",STAKED," PEANUTS"
0590 PRINT "I.E. AN ODD NUMBER, ",
0600 ENDIF
0610 ENDPROC RESULT
0620 //
0630 PROC WINNER
0640 IF OUTCOME=GUESS THEN
0650 PRINT "SO YOU WIN."
0660 PRINT "CONGRATULATIONS!"
0670 COUNTWIN:=COUNTWIN+STAKED
0680 ELSE
0690 PRINT "SO YOU LOSE."
0700 PRINT "I AM SORRY!"
0710 COUNTWIN:=COUNTWIN-STAKED
0720 ENDIF
0730 ENDPROC WINNER
0740 //